home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / wnos5src.zip / SESSION.H < prev    next >
Text File  |  1993-08-09  |  3KB  |  127 lines

  1. #ifndef _SESSION_H
  2. #define _SESSION_H
  3.  
  4. #if !defined(__STDIO_DEF_) && !defined(__STDIO_H)
  5. #include <stdio.h>
  6. #endif
  7.  
  8. #ifndef _GLOBAL_H
  9. #include "global.h"
  10. #endif
  11.  
  12. #ifndef _CONFIG_H
  13. #include "config.h"
  14. #endif
  15.  
  16. #ifndef _HARDWARE_H
  17. #include "hardware.h"
  18. #endif
  19.  
  20. #ifndef _FTP_H
  21. #include "ftp.h"
  22. #endif
  23.  
  24. #ifndef _TELNET_H
  25. #include "telnet.h"
  26. #endif
  27.  
  28. #ifndef _ICMP_H
  29. #include "icmp.h"
  30. #endif
  31.  
  32. #ifndef _AX25_H
  33. #include "ax25.h"
  34. #endif
  35.  
  36. #ifndef _PROC_H
  37. #include "proc.h"
  38. #endif
  39.  
  40. #ifndef _TTY_H
  41. #include "tty.h"
  42. #endif
  43.  
  44. #ifndef _NNTP_H
  45. #include "nntp.h"
  46. #endif
  47.  
  48. #ifndef _POP_H
  49. #include "pop.h"
  50. #endif
  51.  
  52. typedef enum {
  53.     SPLIT = 1, SWAP = 2
  54. } Flag;
  55.  
  56. /* Session control structure; only one entry is used at a time */
  57. typedef enum  {
  58.    FREE        = 0, TELNET   = 1, FTP      = 2, AX25TNC  = 3,
  59.    FINGER      = 4, PING     = 5, NRSESSION= 6, COMMAND  =7,
  60.    MORE        = 8, HOP      = 9, TIP      =10, PPPPASS  =11,
  61.    TRACESESSION=12, RAW      =13, HYPER    =14,
  62. }Stype;
  63.  
  64. typedef enum {
  65.  Raw, Cooked
  66. } Fmode;
  67.  
  68. /* Session control structure; only one entry is used at a time */
  69. struct session {
  70.     Stype type;
  71.     char *name;                /* Name of remote host */
  72.     union {
  73.         struct ftpcli *ftp;
  74.         struct telnet *telnet;
  75.     } cb;
  76.     struct proc *proc;        /* Primary session process (e.g., tn recv) */
  77.     struct proc *proc1;        /* Secondary session process (e.g., tn xmit) */
  78.     struct proc *proc2;        /* Tertiary session process (e.g., upload) */
  79.     int s;                    /* Primary network socket (control for FTP) */
  80.     FILE *record;            /* Receive record file */
  81.     char *rfile;            /* Record file name */
  82.     FILE *upload;            /* Send file */
  83.     char *ufile;            /* Upload file name */
  84.     struct ttystate ttystate;
  85.     struct screen *screen;
  86.     int input;                /* Input socket */
  87.     int output;                /* Output socket */
  88.     Fmode flowmode;            /* control "more" mode */
  89.     int row;                /* Rows remaining until "more" */
  90.     int morewait;            /* Output driver is waiting on us */
  91. #define PPROMPT    1
  92.     int flag;
  93.     int swap;
  94. #define MAXCS        10        /* cmd line buffer */
  95.     char Cs[MAXCS][162];
  96.     int cont;
  97.     int tsavex;                /* used for split-screen option */
  98.     int tsavey;
  99.     int bsavex;
  100.     int bsavey;
  101.     int split;
  102.     int lwrap;                /* linewrap col */
  103. };
  104. #define    NULLSESSION    (struct session *)0
  105.  
  106. extern char *Sestypes[];
  107. extern unsigned Nsessions;            /* Maximum number of sessions */
  108. extern struct session *Sessions;    /* Session descriptors themselves */
  109. extern struct session *Current;        /* Always points to current session */
  110. extern struct session *Lastcurr;    /* Last non-command session */
  111. extern struct session *Command;        /* Pointer to command session */
  112. extern struct session *Trace;        /* Pointer to trace screen DK5DC */
  113.  
  114. /* In session.c: */
  115. void     freesession __ARGS((struct session *sp));
  116. struct     session *sessptr __ARGS((char *cp));
  117. struct     session *newsession __ARGS((char *name,int type,int Flag));
  118. void     upload __ARGS((int unused,void *sp1,void *p));
  119.  
  120. /* In pc.c: */
  121. void     swapscreen __ARGS((struct session *old,struct session *new));
  122.  
  123. extern int16 Lport;
  124. #define    ALERT_EOF    1
  125.  
  126. #endif    /* _SESSION_H */
  127.